import dayjs from 'dayjs'
interface Column {
  field: string
  type?: string
  title?: string
  width?: string
  formatter?: any
}

export interface ProjectData {
  name?: string
  type?: string
  leader?: string
  subjectAreaText?: string
  researchDate?: string
  estimatedBudget?: string
  externalCooperationRequired?: string
  leadingUnitName?: string
  collaboratingUnitNames?: string
}

export interface ItemData {
  projectCode?: string
  projectName?: string
  projectLevel?: string
  projectType?: string
  keyProjectName?: string
  headerName?: string
}

const statusNum = {
  '0': '草稿',
  '1': '审核中',
  '2': '审核通过',
  '3': '驳回（完结）',
}

const statusOptions = [
  {
    label: '草稿',
    value: '0',
  },
  {
    value: '1',
    label: '审核中',
  },
  {
    value: '2',
    label: '审核通过',
  },
  {
    value: '3',
    label: '驳回（完结）',
  },
]

const columnList: Array<Column> = [
  {
    field: 'projectTopicId',
    title: '需求ID',
  },
  {
    field: 'unitName',
    title: '单位名称',
  },
  {
    field: 'projectName',
    title: '项目名称',
  },
  {
    field: 'projectDescription',
    title: '项目描述',
  },
  {
    field: 'researchCycle',
    title: '研究周期',
  },
  {
    field: 'majorRequirement',
    title: '专业需求',
  },
  {
    field: 'demandNumber',
    title: '需求人数',
  },
  {
    field: 'createTime',
    title: '填报时间',
    formatter: ['formatDate', 'yyyy-MM-dd'],
  },
  // {
  //   field: 'status',
  //   title: '需求状态',
  //   type: 'html',
  //   formatter: ({ cellValue }) => {
  //     return `<span style="color:${cellValue == 0 ? '' : cellValue == 1 ? '#12CE66' : '#F8BA2A'}">${statusNum[cellValue]}</span>`
  //   },
  // },
]
export { columnList, statusOptions }
